home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / amos / amoslist-0195.lzh / AMOSLIST / text0266.txt < prev    next >
Encoding:
Text File  |  1995-02-01  |  896 b   |  30 lines

  1. > How does recursive programming work? Suppose I wanted to make a 
  2. > MineSweeper clone, how would I let the computer show all the
  3. > fields that aren't surrounded by a bomb whenever I hit a field
  4. > which is not surrounded by a bomb? 
  5. > Mind, I'm not trying to make a clone here, I just thought it's
  6. > the best way to illustrate whatever I try to... well, er, try,
  7. > really :)
  8.  
  9. Recursive programming works by calling a procedure from itself.
  10. i.e.:
  11. Procedure Test[A]
  12.   Inc A
  13.   If A<10 Then Test[A]
  14. End proc
  15.  
  16. I am not sure this example will work in Amos, though. I seem to 
  17. remember that Amos has some limitations on recursion, for instance 
  18. that the procedure calls may not be nested more than 15 times, 
  19. which makes it useless for most applications.
  20.  
  21. BTW, why would you want to use recursion for this Mines-clone. You 
  22. could just check the array, could you not?
  23.  
  24. Branko Collin
  25. bcollin@mpi.nl
  26.  
  27.  
  28.  
  29.